<?php
if(!defined('ADMIN')){
	exit('Access Denied');
}

$id=empty($_GET['id'])?0:(int)$_GET['id'];
if(empty($id)){
    
     jumpajax('300','模型ID不能为空!','');
}
$modelinfo=$ezhand->select("model","*"," id=".$id);
if(empty($modelinfo)){
       jumpajax('300','模型ID不能为空!','');  
}
if($_POST['sub']=='save'){
    $listorder=$_POST["listorder"];
    if(!empty($listorder)){
     while(list($k,$v)=each($listorder)){
        
        $data=array("listorder"=>$v);
        $ezhand->update("modelfield",$data,'id='.$k);  
            
        
     }  
    }   
    
}
$total=$ezhand->count("modelfield","modelid=".$id);
$row=$ezhand->select_all("modelfield",'*',"modelid=".$id." order by listorder asc,id asc");

?>